﻿@model IEnumerable<WebFitness.Aluno>


@{
    ViewBag.Title = "Index";
}

<h2>Alunos</h2>

<p>
    @Html.ActionLink("Cadastrar", "Create", null, new { @class = "btn btn-large btn-primary" })
</p>
<div class="well no-padding tab-content">
    <div class="tab-pane active" id="user-overview">
        <table class="data-table">
            <thead>
                <tr>
                    <th>@Html.DisplayNameFor(model => model.nome)</th>
                    <th>@Html.DisplayNameFor(model => model.cpf)</th>
                    <th>@Html.DisplayNameFor(model => model.telefone)</th>
                    <th>@Html.DisplayNameFor(model => model.email)</th>
                    <th>@Html.DisplayNameFor(model => model.rua)</th>
                    <th>@Html.DisplayNameFor(model => model.bairro)</th>
                    <th>@Html.DisplayNameFor(model => model.Cidade.dsCidade)</th>
                    <th>@Html.DisplayNameFor(model => model.status)</th>
                    <th class="right">Editar</th>
                </tr>
            </thead>
            <tbody>

                @foreach (var item in Model)
                {
                    <tr>
                        <td>@Html.DisplayFor(modelItem => item.nome)</td>
                        <td>@Html.LabelForModel(item.cpf, new { @class = "exibeCpf" })</td>
                        <td>@Html.LabelForModel(item.telefone, new { @class = "exibeTel" })</td>
                        <td>@Html.DisplayFor(modelItem => item.email)</td>
                        <td>@Html.DisplayFor(modelItem => item.rua)</td>
                        <td>@Html.DisplayFor(modelItem => item.bairro)</td>
                        <td>@Html.DisplayFor(modelItem => item.Cidade.dsCidade)</td>
                        <td>
                            @if (item.status == (byte)WebFitness.Status.Ativo)
                            {
                                <span class="label label-success">@WebFitness.Status.Ativo</span>
                            }
                            else
                            {
                                <span class="label label-important">@WebFitness.Status.Inativo</span>
                            }

                        </td>

                        <td  class="right">
                            @Html.ActionLink("Detalhes", "Details", new { id = item.idAluno }, new { @class = "btn" })

                            @Html.ActionLink("Editar", "Edit", new { id = item.idAluno }, new { @class = "btn btn-info" })

                            @if (item.status == (byte)WebFitness.Status.Ativo)
                            {
                                @Html.ActionLink("Inativar", "Inactive", new { id = item.idAluno }, new { @class = "btn btn-danger" })
                            }
                            else
                            {
                                @Html.ActionLink("Ativar", "Active", new { id = item.idAluno }, new { @class = "btn btn-success" })
                            }
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>
